package com.ruoyi.system.support;

import com.ruoyi.system.domain.YktAccessEvent;
import com.ruoyi.system.domain.YktVisitorRecord;
import com.ruoyi.system.service.IYktAccessEventService;
import com.ruoyi.system.service.IYktVisitorRecordService;
import org.dom4j.*;
import org.dom4j.io.SAXReader;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;

import java.io.File;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

@EnableScheduling // 开启定时任务
@Configuration // 此注解必须加,不加不会扫描到定时任务,也可使用@Component
@Service
public class DOM4JTest {

    @Autowired
    private IYktVisitorRecordService yktVisitorRecordService;
    @Autowired
    private IYktAccessEventService yktAccessEventService;
    /**
     * xml文件路径
     */
    private static final String XML_PATH = "G:\\work-space\\my-project\\dw-test\\src\\main\\java\\com\\dw\\study\\dom\\books.xml";

    private static final String XML_STR = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
            "<rows pos=\"0\" total_count=\"2138\">\n" +
            "    <row id=\"1574321[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >17794229886</cell>\n" +
            "        <cell >李建春</cell>\n" +
            "        <cell >00000051</cell>\n" +
            "        <cell >基建后勤处</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 11:30:20</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574320[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >17794229886</cell>\n" +
            "        <cell >李建春</cell>\n" +
            "        <cell >00000051</cell>\n" +
            "        <cell >基建后勤处</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 11:30:15</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574308[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >18215142956</cell>\n" +
            "        <cell >王锡林</cell>\n" +
            "        <cell >000003C3</cell>\n" +
            "        <cell >生物医药基地管理部</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 11:22:38</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574307[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >18215142956</cell>\n" +
            "        <cell >王锡林</cell>\n" +
            "        <cell >000003C3</cell>\n" +
            "        <cell >生物医药基地管理部</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 11:22:33</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574306[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >13893465405</cell>\n" +
            "        <cell >曹守权</cell>\n" +
            "        <cell >00000070</cell>\n" +
            "        <cell >生物安全与管理处</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 11:22:21</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574302[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >13919804086</cell>\n" +
            "        <cell >陈海燕</cell>\n" +
            "        <cell >00000507</cell>\n" +
            "        <cell >生产部</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 11:22:00</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574292[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >15716294659</cell>\n" +
            "        <cell >蒋佳楠</cell>\n" +
            "        <cell >20004292</cell>\n" +
            "        <cell >口蹄疫与新发病流行病学团队</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 11:18:38</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574290[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >18890766153</cell>\n" +
            "        <cell >邱腾涛</cell>\n" +
            "        <cell >20004291</cell>\n" +
            "        <cell >口蹄疫与新发病流行病学团队</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 11:18:34</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574289[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >18890766153</cell>\n" +
            "        <cell >邱腾涛</cell>\n" +
            "        <cell >20004291</cell>\n" +
            "        <cell >口蹄疫与新发病流行病学团队</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 11:18:29</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574270[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >15193285895</cell>\n" +
            "        <cell >杨兰楠</cell>\n" +
            "        <cell >20004051</cell>\n" +
            "        <cell >草食动物细菌病团队</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 11:03:14</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574269[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >15193285895</cell>\n" +
            "        <cell >杨兰楠</cell>\n" +
            "        <cell >20004051</cell>\n" +
            "        <cell >草食动物细菌病团队</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 11:03:09</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574266[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >18890766153</cell>\n" +
            "        <cell >邱腾涛</cell>\n" +
            "        <cell >20004291</cell>\n" +
            "        <cell >口蹄疫与新发病流行病学团队</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 10:57:51</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574261[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >20230938</cell>\n" +
            "        <cell >陈建英</cell>\n" +
            "        <cell >20003217</cell>\n" +
            "        <cell >兽研所家属区</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 10:52:21</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574250[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >13321324225</cell>\n" +
            "        <cell >陈睿</cell>\n" +
            "        <cell >20004007</cell>\n" +
            "        <cell >草食动物细菌病团队</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 10:44:59</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574248[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >15379081676</cell>\n" +
            "        <cell >魏立军</cell>\n" +
            "        <cell >0000059E</cell>\n" +
            "        <cell >家禽疫病病原生物学研究中心</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 10:43:46</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574247[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >15379081676</cell>\n" +
            "        <cell >魏立军</cell>\n" +
            "        <cell >0000059E</cell>\n" +
            "        <cell >家禽疫病病原生物学研究中心</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 10:43:42</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574225[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >18</cell>\n" +
            "        <cell >2025/11/06 10:21:37</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574224[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >18</cell>\n" +
            "        <cell >2025/11/06 10:21:35</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574217[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >15216163875</cell>\n" +
            "        <cell >王良锋</cell>\n" +
            "        <cell >20004063</cell>\n" +
            "        <cell >口蹄疫与新发病流行病学团队</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 10:08:48</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574216[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >15216163875</cell>\n" +
            "        <cell >王良锋</cell>\n" +
            "        <cell >20004063</cell>\n" +
            "        <cell >口蹄疫与新发病流行病学团队</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 10:08:44</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574210[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >18119389620</cell>\n" +
            "        <cell >屈灵活</cell>\n" +
            "        <cell >20001498</cell>\n" +
            "        <cell >兽研所家属区</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 10:05:00</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574209[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >18119389620</cell>\n" +
            "        <cell >屈灵活</cell>\n" +
            "        <cell >20001498</cell>\n" +
            "        <cell >兽研所家属区</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 10:04:55</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574207[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >13619369895</cell>\n" +
            "        <cell >王立宏</cell>\n" +
            "        <cell >0000045D</cell>\n" +
            "        <cell >运行保障部</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 10:03:26</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574205[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >13619369895</cell>\n" +
            "        <cell >王立宏</cell>\n" +
            "        <cell >0000045D</cell>\n" +
            "        <cell >运行保障部</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 10:03:22</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574203[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >18</cell>\n" +
            "        <cell >2025/11/06 10:01:29</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574200[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >20230824</cell>\n" +
            "        <cell >曾树和</cell>\n" +
            "        <cell >20003103</cell>\n" +
            "        <cell >兽研所家属区</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 09:59:38</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574199[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >20230824</cell>\n" +
            "        <cell >曾树和</cell>\n" +
            "        <cell >20003103</cell>\n" +
            "        <cell >兽研所家属区</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 09:59:34</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574189[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >15379045659</cell>\n" +
            "        <cell >储昭厚</cell>\n" +
            "        <cell >20001522</cell>\n" +
            "        <cell >兽研所家属区</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 09:55:33</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574187[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >15379045659</cell>\n" +
            "        <cell >储昭厚</cell>\n" +
            "        <cell >20001522</cell>\n" +
            "        <cell >兽研所家属区</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 09:55:28</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574184[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >18</cell>\n" +
            "        <cell >2025/11/06 09:53:54</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574183[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >13919956318</cell>\n" +
            "        <cell >孙世雄</cell>\n" +
            "        <cell >0000047D</cell>\n" +
            "        <cell >运行保障部</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 09:53:52</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574181[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >13659456742</cell>\n" +
            "        <cell >李仲皋</cell>\n" +
            "        <cell >00000460</cell>\n" +
            "        <cell >运行保障部</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 09:51:28</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574173[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >18</cell>\n" +
            "        <cell >2025/11/06 09:34:05</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574171[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >18</cell>\n" +
            "        <cell >2025/11/06 09:33:57</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574170[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >20231106</cell>\n" +
            "        <cell >杨禄明</cell>\n" +
            "        <cell >20003385</cell>\n" +
            "        <cell >兽研所家属区</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 09:33:31</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574155[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >13369434647</cell>\n" +
            "        <cell >汪明彦</cell>\n" +
            "        <cell >20001491</cell>\n" +
            "        <cell >兽研所家属区</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 09:20:24</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574154[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >13369434647</cell>\n" +
            "        <cell >汪明彦</cell>\n" +
            "        <cell >20001491</cell>\n" +
            "        <cell >兽研所家属区</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 09:20:20</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574149[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >18</cell>\n" +
            "        <cell >2025/11/06 09:18:42</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574148[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >18</cell>\n" +
            "        <cell >2025/11/06 09:18:35</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574147[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >18</cell>\n" +
            "        <cell >2025/11/06 09:18:27</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574128[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >18610518277</cell>\n" +
            "        <cell >王孟冬</cell>\n" +
            "        <cell >20004054</cell>\n" +
            "        <cell >口蹄疫与新发病流行病学团队</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 09:10:14</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574127[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >18610518277</cell>\n" +
            "        <cell >王孟冬</cell>\n" +
            "        <cell >20004054</cell>\n" +
            "        <cell >口蹄疫与新发病流行病学团队</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 09:10:10</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574112[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >15502505880</cell>\n" +
            "        <cell >唐丽</cell>\n" +
            "        <cell >000001E7</cell>\n" +
            "        <cell >草食动物细菌病团队</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 09:02:18</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574111[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >15680988137</cell>\n" +
            "        <cell >尤留超</cell>\n" +
            "        <cell >000001E9</cell>\n" +
            "        <cell >草食动物细菌病团队</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 09:02:14</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574110[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >15680988137</cell>\n" +
            "        <cell >尤留超</cell>\n" +
            "        <cell >000001E9</cell>\n" +
            "        <cell >草食动物细菌病团队</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 09:02:10</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574109[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >18189514324</cell>\n" +
            "        <cell >秦峰</cell>\n" +
            "        <cell >000002C5</cell>\n" +
            "        <cell >口蹄疫防控技术团队</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 09:01:58</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574108[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >18189514324</cell>\n" +
            "        <cell >秦峰</cell>\n" +
            "        <cell >000002C5</cell>\n" +
            "        <cell >口蹄疫防控技术团队</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 09:01:54</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574104[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell ></cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >18</cell>\n" +
            "        <cell >2025/11/06 09:00:02</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574100[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >20230824</cell>\n" +
            "        <cell >曾树和</cell>\n" +
            "        <cell >20003103</cell>\n" +
            "        <cell >兽研所家属区</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 08:54:53</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "    <row id=\"1574098[]9\" >\n" +
            "        <cell ></cell>\n" +
            "        <cell >20230824</cell>\n" +
            "        <cell >曾树和</cell>\n" +
            "        <cell >20003103</cell>\n" +
            "        <cell >兽研所家属区</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >200013</cell>\n" +
            "        <cell >门禁通道西侧出</cell>\n" +
            "        <cell >10.77.18.62</cell>\n" +
            "        <cell >西侧出</cell>\n" +
            "        <cell >0</cell>\n" +
            "        <cell >101</cell>\n" +
            "        <cell >2025/11/06 08:54:48</cell>\n" +
            "        <cell >1</cell>\n" +
            "    </row>\n" +
            "</rows>";

//    public static void main(String[] args) {
//        // 创建SAXReader的对象reader
//        SAXReader reader = new SAXReader();
//        try {
//            // 通过reader对象的read方法加载books.xml文件, 获取Document对象。
////            Document document = reader.read(new File(XML_PATH));
//            Document document = reader.read(XML_STR);
//            // 通过document对象获取根节点bookstore
//            Element bookStore = document.getRootElement();
//            // 通过element对象的elementIterator方法获取迭代器
//            Iterator it = bookStore.elementIterator();
//            // 遍历迭代器，获取根节点中的信息（书籍）
//            while (it.hasNext()) {
//                System.out.println("=====开始遍历某一本书=====");
//                Element book = (Element) it.next();
//                // 获取book的属性名以及 属性值
//                List<Attribute> bookAttrs = book.attributes();
//                for (Attribute attr : bookAttrs) {
//                    System.out.println("属性名：" + attr.getName() + "--属性值：" + attr.getValue());
//                }
//                Iterator itt = book.elementIterator();
//                while (itt.hasNext()) {
//                    Element bookChild = (Element) itt.next();
//                    System.out.println("节点名：" + bookChild.getName() + "--节点值：" + bookChild.getStringValue());
//                }
//                System.out.println("=====结束遍历某一本书=====");
//            }
//        } catch (DocumentException e) {
//            e.printStackTrace();
//        }
//    }

//    public void parseXml() {
//        String xmlString = XML_STR;
//        try {
//            // 解析XML字符串
//            Document document = DocumentHelper.parseText(xmlString);
//
//            // 获取根元素
//            Element root = document.getRootElement();
//
//            // 遍历根元素下的所有子元素
//            for (Element element : (List<Element>) root.elements()) {
//                System.out.println("Element name: " + element.getName());
//                System.out.println("Element value: " + element.getText());
//                YktVisitorRecord yktVisitorRecord = new YktVisitorRecord();
//                for (int i = 0; i < element.elements().size(); i++) {
//                    Element element1 = element.elements().get(i);
//                    System.out.println("Element name: " + element1.getName());
//                    System.out.println("Element value: " + element1.getText());
//                    if(i == 2){
//                        yktVisitorRecord.setVisitorName(element1.getText());
//                        System.out.println("name: " + element1.getText());
//                    }
//                    if(i == 4){
//                        yktVisitorRecord.setCsName(element1.getText());
//                    }
//
//                    if(i == 6){
//                        yktVisitorRecord.setmName(element1.getText());
//                    }
//
//                    if(i == 8){
//                        yktVisitorRecord.setJcsj(element1.getText());
//                    }
//                }
//
//                yktVisitorRecordService.insertYktVisitorRecord(yktVisitorRecord);
//            }
//        } catch (DocumentException e) {
//            e.printStackTrace();
//        }
//    }

//       "    <row id=\"1574098[]9\" >\n" +
//               "        <cell ></cell>\n" +
//               "        <cell >20230824</cell>\n" +
//               "        <cell >曾树和</cell>\n" +
//               "        <cell >20003103</cell>\n" +
//               "        <cell >兽研所家属区</cell>\n" +
//               "        <cell >0</cell>\n" +
//               "        <cell >200013</cell>\n" +
//               "        <cell >门禁通道西侧出</cell>\n" +
//               "        <cell >10.77.18.62</cell>\n" +
//               "        <cell >西侧出</cell>\n" +
//               "        <cell >0</cell>\n" +
//               "        <cell >101</cell>\n" +
//               "        <cell >2025/11/06 08:54:48</cell>\n" +
//               "        <cell >1</cell>\n" +
//               "    </row>\n" +
    @Scheduled(cron = "0 */1 * * * ?")
    public void parseXml() {
        String xmlString = XML_STR;
        try {
            // 解析XML字符串
            Document document = DocumentHelper.parseText(xmlString);

            // 获取根元素
            Element root = document.getRootElement();

            // 遍历根元素下的所有子元素
            for (Element element : (List<Element>) root.elements()) {
                System.out.println("Element name: " + element.getName());
                System.out.println("Element value: " + element.getText());
                YktAccessEvent yktAccessEvent = new YktAccessEvent();
                for (int i = 0; i < element.elements().size(); i++) {
                    Element element1 = element.elements().get(i);
                    System.out.println("Element name: " + element1.getName());
                    System.out.println("Element value: " + element1.getText());
                    if(i == 1){
                        yktAccessEvent.setJobNo(element1.getText());
                    }
                    if(i == 2){
                        yktAccessEvent.setPersonName(element1.getText());
                        System.out.println("name: " + element1.getText());
                    }
                    if(i == 3){
                        yktAccessEvent.setCardNo(element1.getText());
                    }
                    if(i == 4){
                        yktAccessEvent.setOrgName(element1.getText());
//                        yktAccessEvent.setDevName(element1.getText());
//                        yktVisitorRecord.setCsName(element1.getText());
                    }

                    if(i == 7){
                        yktAccessEvent.setDevName(element1.getText());
                    }

                    if(i == 9){
                        yktAccessEvent.setDoorName(element1.getText());
                    }

                    if(i == 12){
                        String dateString = element1.getText();
                        SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
                        Date date = sdf.parse(dateString);
                        yktAccessEvent.setEventTime( date);

//                        yktAccessEvent.setEventTimeStr(element1.getText());
                    }

                    if(i == 8){
//                        yktAccessEvent.setEventTime(element1.getText());
                    }
                }
                YktAccessEvent se = new YktAccessEvent();
                se.setEventTime(yktAccessEvent.getEventTime());
                se.setPersonName(yktAccessEvent.getPersonName());
                se.setCardNo(yktAccessEvent.getCardNo());
                List<YktAccessEvent> list =yktAccessEventService.selectYktAccessEventList(se);
                if(ObjectUtils.isEmpty( list)){
                    yktAccessEventService.insertYktAccessEvent(yktAccessEvent);
                }

            }
        } catch (DocumentException | ParseException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        String xmlString = XML_STR;
        try {
            // 解析XML字符串
            Document document = DocumentHelper.parseText(xmlString);

            // 获取根元素
            Element root = document.getRootElement();

            // 遍历根元素下的所有子元素
            for (Element element : (List<Element>) root.elements()) {
                System.out.println("Element name: " + element.getName());
                System.out.println("Element value: " + element.getText());
                YktVisitorRecord yktVisitorRecord = new YktVisitorRecord();
                for (int i = 0; i < element.elements().size(); i++) {
                    Element element1 = element.elements().get(i);
                    System.out.println("Element name: " + element1.getName());
                    System.out.println("Element value: " + element1.getText());
                    if(i == 2){
                        yktVisitorRecord.setVisitorName(element1.getText());
                        System.out.println("name: " + element1.getText());
                    }
                    if(i == 4){
                        yktVisitorRecord.setCsName(element1.getText());
                    }

                    if(i == 6){
                        yktVisitorRecord.setmName(element1.getText());
                    }

                    if(i == 8){
                        yktVisitorRecord.setJcsj(element1.getText());
                    }
                }

//                yktVisitorRecordService.insertYktVisitorRecord(yktVisitorRecord);
            }
        } catch (DocumentException e) {
            e.printStackTrace();
        }
    }
}
